
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html">

<h:body>

		<h:form>
			<p:dataTable id="orderListTable" var="order"
				value="#{orderList.orders}" paginator="true" rows="10"
				widgetVar="ordersTable">
				<f:facet name="header">
					<div style="text-align: right">
						<p:outputPanel>
							<h:outputText value="Search all fields:" />
							<p:inputText id="globalFilter" onkeyup="ordersTable.filter()"
								style="width:150px" />
						</p:outputPanel>
					</div>
				</f:facet>

				<p:column sortBy="#{order.orderId}" filterBy="#{order.orderId}"
					style="width:10%">
					<f:facet name="header">
						<h:outputText value="Order Id:" />
					</f:facet>
					<h:outputText value="#{order.orderId}" />
				</p:column>

				<p:column sortBy="#{order.orderName}" filterBy="#{order.orderName}"
					style="width:40%">
					<f:facet name="header">
						<h:outputText value="Order Name" />
					</f:facet>
					<h:outputText value="#{order.orderName}" />
				</p:column>

				<p:column sortBy="#{order.orderPattern.plateArticle.articleId}"
					filterBy="#{order.orderPattern.plateArticle.articleId}"
					style="width:20%">
					<f:facet name="header">
						<h:outputText value="Article" />
					</f:facet>
					<h:outputText value="#{order.orderPattern.plateArticle.articleId}" />
				</p:column>

				<p:column sortBy="#{order.status.status}"
					filterBy="#{order.status.status}" style="width:10%">
					<f:facet name="header">
						<h:outputText value="Status" />
					</f:facet>
					<h:outputText value="#{order.status.status}" />
				</p:column>

				<p:column style="width:10%">
					<p:commandButton action="#{orderList.viewOrder(order.orderId)}"
						icon="ui-icon-search" ajax="false" />
					<p:commandButton action="#{orderList.editOrder(order.orderId)}"
						icon="ui-icon-pencil" ajax="false" />
				</p:column>
			</p:dataTable>
		</h:form>

</h:body>
</html>